﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using AutoIt_Elements.GUI;
using AutoIt_Elements.Core.LanguageManager;

namespace AutoIt_IDE
{
    static class Program
    {
        public static LanguageManager langManager = new LanguageManager();
        public const bool DEBUG = true;
        /// <summary>
        /// Der Haupteinstiegspunkt für die Anwendung.
        /// </summary>
        [STAThread]
        static void Main()
        {
            // Load configs
            StartApplication();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
        }

        private static void StartApplication()
        {
            if (langManager.CurrentLanguage == null)
                langManager.CurrentLanguage = LanguageManager.XMLLoadLanguage(Environment.CurrentDirectory + @"\Lang\lang_de.xml");
        }

        public static void ExitApplication()
        {
            Application.Exit();
        }

        public static void WriteDebugLine(string msg)
        {
            if (DEBUG)
                Console.WriteLine("[DEBUG] " + msg);
        }
    }
}
